Required definitions are contained in _<<<<_ssss_yyyy_ssss_////_ssss_tttt_rrrr_llll_oooo_gggg_...._hhhh_>>>>, _<<<<_ssss_yyyy_ssss_////_llll_oooo_gggg_...._hhhh_>>>>, and
_<<<<_ssss_yyyy_ssss_////_ssss_yyyy_ssss_llll_oooo_gggg_...._hhhh_>>>>. _m_i_d is the STREAMS module id number for the module or
driver submitting the _llll_oooo_gggg message. _s_i_d is an internal sub-id number
usually used to identify a particular minor device of a driver. _l_e_v_e_l is
a tracing level that allows for selective screening out of low priority
messages from the tracer. _f_l_a_g_s are any combination of _SSSS_LLLL______EEEE_RRRR_RRRR_OOOO_RRRR (the
message is for the error logger), _SSSS_LLLL______TTTT_RRRR_AAAA_CCCC_EEEE (the message is for the
tracer), _SSSS_LLLL______CCCC_OOOO_NNNN_SSSS_OOOO_LLLL_EEEE (the message is for the console logger), _SSSS_LLLL______FFFF_AAAA_TTTT_AAAA_LLLL
(advisory notification of a fatal error), and _SSSS_LLLL______NNNN_OOOO_TTTT_IIII_FFFF_YYYY (request that a
copy of the message be mailed to the system administrator). _f_m_t is a
_pppp_rrrr_iiii_nnnn_tttt_ffff(3S) style format string, except that %s, %e, %E, %g, and %G
conversion specifications are not handled. Up to _NNNN_LLLL_OOOO_GGGG_AAAA_RRRR_GGGG_SSSS (currently 3)
_llll_oooo_gggg is opened via the _cccc_llll_oooo_nnnn_eeee interface, _////_dddd_eeee_vvvv_////_llll_oooo_gggg. Each open of _////_dddd_eeee_vvvv_////_llll_oooo_gggg
obtains a separate stream to _llll_oooo_gggg. In order to receive _llll_oooo_gggg messages, a
process must first notify _llll_oooo_gggg whether it is an error logger, trace
logger, or console logger via a STREAMS _IIII______SSSS_TTTT_RRRR _iiii_oooo_cccc_tttt_llll call (see below).
For the console logger, the _IIII______SSSS_TTTT_RRRR _iiii_oooo_cccc_tttt_llll has an _iiii_cccc______cccc_mmmm_dddd field of _IIII______CCCC_OOOO_NNNN_SSSS_LLLL_OOOO_GGGG,
with no accompanying data. For the error logger, the _IIII______SSSS_TTTT_RRRR _iiii_oooo_cccc_tttt_llll has an
_iiii_cccc______cccc_mmmm_dddd field of _IIII______EEEE_RRRR_RRRR_LLLL_OOOO_GGGG, with no accompanying data. For the trace
logger, the _iiii_oooo_cccc_tttt_llll has an _iiii_cccc______cccc_mmmm_dddd field of _IIII______TTTT_RRRR_CCCC_LLLL_OOOO_GGGG, and must be
accompanied by a data buffer containing an array of one or more struct
_tttt_rrrr_aaaa_cccc_eeee______iiii_dddd_ssss elements. Each _tttt_rrrr_aaaa_cccc_eeee______iiii_dddd_ssss structure specifies an _m_i_d, _s_i_d, and
_l_e_v_e_l from which message will be accepted. _ssss_tttt_rrrr_llll_oooo_gggg will accept messages
whose _m_i_d and _s_i_d exactly match those in the _tttt_rrrr_aaaa_cccc_eeee______iiii_dddd_ssss structure, and
whose level is less than or equal to the level given in the _tttt_rrrr_aaaa_cccc_eeee______iiii_dddd_ssss
PPPPaaaaggggeeee 1111
lllloooogggg((((7777)))) lllloooogggg((((7777))))
structure. A value of -1 in any of the fields of the _tttt_rrrr_aaaa_cccc_eeee______iiii_dddd_ssss structure
indicates that any value is accepted for that field.
Once the logger process has identified itself via the _iiii_oooo_cccc_tttt_llll call, _llll_oooo_gggg
will begin sending up messages subject to the restrictions noted above.
These messages are obtained via the _gggg_eeee_tttt_mmmm_ssss_gggg_((((_2222_)))) system call. The control
part of this message contains a _llll_oooo_gggg______cccc_tttt_llll structure, which specifies the
_m_i_d, _s_i_d, _l_e_v_e_l, _f_l_a_g_s, time in ticks since boot that the message was
submitted, the corresponding time in seconds since Jan. 1, 1970, a
sequence number, and a priority. The time in seconds since 1970 is
provided so that the date and time of the message can be easily computed,
and the time in ticks since boot is provided so that the relative timing
of _llll_oooo_gggg messages can be determined.
The priority is comprised of a priority code and a facility code, found
in _<<<<_ssss_yyyy_ssss_////_ssss_yyyy_ssss_llll_oooo_gggg_...._hhhh_>>>>. If _SSSS_LLLL______CCCC_OOOO_NNNN_SSSS_OOOO_LLLL_EEEE is set in _f_l_a_g_s, the priority code is
set as follows. If _SSSS_LLLL______WWWW_AAAA_RRRR_NNNN is set, the priority code is set to
_LLLL_OOOO_GGGG______WWWW_AAAA_RRRR_NNNN_IIII_NNNN_GGGG. If _SSSS_LLLL______FFFF_AAAA_TTTT_AAAA_LLLL is set, the priority code is set to _LLLL_OOOO_GGGG______CCCC_RRRR_IIII_TTTT.
If _SSSS_LLLL______EEEE_RRRR_RRRR_OOOO_RRRR is set, the priority code is set to _LLLL_OOOO_GGGG______EEEE_RRRR_RRRR. If _SSSS_LLLL______NNNN_OOOO_TTTT_EEEE is
set, the priority code is set to _LLLL_OOOO_GGGG______NNNN_OOOO_TTTT_IIII_CCCC_EEEE. If _SSSS_LLLL______TTTT_RRRR_AAAA_CCCC_EEEE is set, the
priority code is set to _LLLL_OOOO_GGGG______DDDD_EEEE_BBBB_UUUU_GGGG. If only _SSSS_LLLL______CCCC_OOOO_NNNN_SSSS_OOOO_LLLL_EEEE is set, the
priority code is set to _LLLL_OOOO_GGGG______IIII_NNNN_FFFF_OOOO. Messages originating from the kernel
have the facility code set to _LLLL_OOOO_GGGG______KKKK_EEEE_RRRR_NNNN. Most messages originating from
user processes will have the facility code set to _LLLL_OOOO_GGGG______UUUU_SSSS_EEEE_RRRR.
Different sequence numbers are maintained for the error and trace logging
streams, and are provided so that gaps in the sequence of messages can be
determined (during times of high message traffic some messages may not be
delivered by the logger to avoid hogging system resources). The data
part of the message contains the unexpanded text of the format string
(null terminated), followed by _NNNN_LLLL_OOOO_GGGG_AAAA_RRRR_GGGG_SSSS words for the arguments to the
format string, aligned on the first word boundary following the format
string.
A process may also send a message of the same structure to _llll_oooo_gggg, even if
it is not an error or trace logger. The only fields of the _llll_oooo_gggg______cccc_tttt_llll
structure in the control part of the message that are accepted are the
_l_e_v_e_l, _f_l_a_g_s, and _p_r_i fields; all other fields are filled in by _llll_oooo_gggg
before being forwarded to the appropriate logger. The data portion must
contain a null terminated format string, and any arguments (up to
_NNNN_LLLL_OOOO_GGGG_AAAA_RRRR_GGGG_SSSS) must be packed one word each, on the next word boundary
following the end of the format string.
_EEEE_NNNN_XXXX_IIII_OOOO is returned for _IIII______TTTT_RRRR_CCCC_LLLL_OOOO_GGGG _iiii_oooo_cccc_tttt_lllls without any _tttt_rrrr_aaaa_cccc_eeee______iiii_dddd_ssss structures,
or for any unrecognized _IIII______SSSS_TTTT_RRRR _iiii_oooo_cccc_tttt_llll calls. Incorrectly formatted _llll_oooo_gggg
messages sent to the driver by a user process are silently ignored (no
error results).
Processes that wish to write a message to the console logger may direct
their output to _////_dddd_eeee_vvvv_////_cccc_oooo_nnnn_ssss_llll_oooo_gggg, using either _wwww_rrrr_iiii_tttt_eeee(2) or _pppp_uuuu_tttt_mmmm_ssss_gggg(2).
PPPPaaaaggggeeee 2222
lllloooogggg((((7777)))) lllloooogggg((((7777))))
EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
Example of _IIII______EEEE_RRRR_RRRR_LLLL_OOOO_GGGG notification.